1. Field of the Invention
The present invention relates to a method for controlling an exposure level of a frame, a computer readable recording media for performing the method and an image processing system applying the method, and particularly relates to a method for controlling an exposure level via adjusting the integration time, the analog gain and the digital gain for each frame, a computer readable recording media for performing the method and an image processing system applying the method.
2. Description of the Prior Art
FIG. 1 is a circuit diagram illustrating a conventional image sensor 100. As shown in FIG. 1, the image sensor 100, which generates an output image signal OS to a display, comprises a pixel array 101, a read circuit 103, an analog amplifier 105, an analog to digital converter 106, and a digital gain unit 107. The pixel array 101 senses light to generate at least one light sensing signal and the read circuit 103 reads and outputs the light sensing signal IS, which is an analog signal. If a frame is read from the pixel array 101, a plurality of light sensing signals IS corresponding to the frame are generated and read from the pixel array 101.
The analog amplifier 105 amplifies the light sensing signal IS to generate an amplified image sensing signal AIS. The analog to digital converter 106 converts the amplified image sensing signal AIS to a digital image sensing signal DIS. The control unit 109 controls the operations for the pixel array 101, the analog amplifier 105 and the digital gain unit 107 via exposure parameters comprising: an integration time IN, an analog gain AG and a digital gain DG. Please note the term “amplify” in this application is not limited to amplify via a gain which is larger than 1. The term “amplify” in this application can indicate amplify via a gain which is smaller than 1.
For more detail, the control unit 109 contains a statistics module and an exposure decision module, which can be software, firmware or hardware. The statistics module computes a mean or a weighted mean from the mean values of color channels of a frame. If the calculated mean is not within a convergent zone, the exposure decision module will compare the calculated mean with a given target mean value, and then decide a new desired exposure level. Based on the new desired exposure level, new exposure parameters will be decided. That is, a new integration time IN, a new analog gain AG and a new digital gain DG will be decided.
The analog gain AG indicates the gain of the analog amplifier 105, and the digital gain DG indicates the gain of the digital gain unit 107. The definition of the integration time IN under a rolling shutter structure is as follows: To start a new frame, each row is reset in sequence by a reset signal. After the decided integration time is over, each row is read in sequence by a read signal. After the whole frame (or a part of rows) is read, the statistics module will calculate a mean of the frame, and then the exposure decision module will decide a new integration time, a new analog gain, and a new digital gain. The control unit 109 then applies these exposure parameters to the image sensor 100.
For a conventional image sensor, the new integration time, the analog gain and the new digital gain are concurrently applied to the same frame after they are updated. However, a time delay issue may occur while applying these exposure parameters to generate a new frame. For example, if a frame n is read and the new exposure parameters are decided, the frame n+1 has already started to expose. So after the new parameters are updated, the new integration time can only be applied to frame n+2. Here the operation “update” indicates the new exposure parameters are generated by the control unit and the control unit generates a command to the image sensor, and the operation “apply” indicates the image sensor applies the new exposure parameters to a new frame according to the command from the control unit. Additionally, the image sensor may not apply the new exposure parameters immediately after receiving the new exposure parameters.
Since there is a timing delay issue between the exposure parameters updating by a control unit and the frame generation according to the exposure parameters by an image sensor, a skip control module is used to control the timing. To ensure that each time the new integration time, the new analog gain and the new digital gain are all applied to the same frame, the skip control module restricts the exposure decision module to update the exposure parameters only for some frames. Or, the skip control module restricts the exposure decision module to update only for some frames to slow the updating rate.
FIG. 2 is a schematic diagram illustrating an example of frame skip operation for a conventional image sensor. In this example, 3 frames are skipped. That is, once the control unit updates the new exposure parameters, three frames are skipped before the next new exposure parameters are updated. As shown in FIG. 2, a counter value decreases if a frame is generated by the image sensor. However, in this case, the exposure parameters are only updated for a frame corresponding to the counter value 0. Also, the frame corresponding to the counter value 2 applies the new exposure parameters due to the time delay issue. In other examples, the delay time between the updating operation and the applying operation is an integer and more than one frame.
However, such technique may causes a non-smooth brightness change since the exposure parameters are not updated for each frame. Additionally, the convergence for such technique is slow since only exposure parameters for a few frames are updated.